﻿<Page
    x:Class="Chant.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Chant"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    DataContext="{Binding RelativeSource={RelativeSource Self}}"
    mc:Ignorable="d">

    <Page.Resources>
        <Style x:Key="PlayButtonStyle" TargetType="Button">
            <Setter Property="Height" Value="60" />
            <Setter Property="Margin" Value="5 10 5 10" />
        </Style>
    </Page.Resources>

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="160"></RowDefinition>
        </Grid.RowDefinitions>

        <StackPanel Margin="10">
            <Button Click="PlayChant" Tag="Neungumshinju.mp3" Style="{StaticResource PlayButtonStyle}">능엄신주(정원스님)</Button>
            <Button Click="PlayChant" Tag="Light.mp3" Style="{StaticResource PlayButtonStyle}">광명진언(혜광스님)</Button>
        </StackPanel>
        <Grid Margin="10 0 10 0" Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="40"></RowDefinition>
                <RowDefinition Height="40"></RowDefinition>
                <RowDefinition Height="80"></RowDefinition>
            </Grid.RowDefinitions>
            <MediaElement x:Name="mediaPlayer" />
            <Slider x:Name="sliderProgress" VerticalAlignment="Center" ValueChanged="SeekToMediaPosition" />

            <TextBlock x:Name="mediaUrl" Grid.Row="1" FontSize="40" />

            <StackPanel Name="spMediaControl" Grid.Row="2" Orientation="Horizontal">
                <Button x:Name="btnPlay" Content="Play" Width="111" Height="43" Click="btnPlay_Click"/>
                <Button x:Name="btnPause" Content="Pause"  Width="111" Height="43" Click="btnPause_Click"/>
                <Button x:Name="btnStop" Content="Stop"  Width="111" Height="43" Click="btnStop_Click"/>

                <CheckBox x:Name="chkAutoRewind" Content="Auto Rewind" IsChecked="{Binding Path=IsAutoRewind, Mode=TwoWay}" />
            </StackPanel>
        </Grid>
    </Grid>
</Page>
